#pragma once

#include <cstdint>
#include <ctime>
#include <string>
#include <vector>

// Define the struct for the 'parkInfo' table
struct ParkInfo {
    enum class Status : uint8_t { EXIT, ENTER, SPOT };
    constexpr static const char *STATUS[] = {"exit", "enter", "spot"};
    std::string id;
    std::string license_plate;
    Status curr_status;
    std::string spot_id;
    std::time_t enter_time; // Entry time of the car
    std::time_t exit_time;  // Exit time of the car
    std::string enter_driver;
    std::string exit_driver;
    uint64_t cost;

    static int get_status(std::string s) {
        for (int i = 0; i < 3; i++) {
            if (s == STATUS[i])
                return i;
        }
        return -1;
    }
};

/**
 * @brief
 * CREATE TABLE IF NOT EXISTS parking_space (
    id INTEGER PRIMARY KEY,
    curr_status INTEGER NOT NULL,
    curr_car_plate_number varchar(64)
    );
 *
 */
struct Spot {
    enum class Status : uint8_t { AVAILABLE, OCCUPIED };
    constexpr static const char *STATUS[] = {"occupied", "available"};
    std::string id;
    Status curr_status;
    std::string info_id;
    static int get_status(std::string s) {
        for (int i = 0; i < 2; i++) {
            if (s == STATUS[i])
                return i;
        }
        return -1;
    }
};